<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/



/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {

    Route::group(['namespace'=>'WAP'], function () {
        Route::get('/', 'Home\HomeController@index');                //   首页
        Route::get('/buy', 'Buy\BuyController@index');                   //   购买
        Route::get('/helps', 'Help\IndexController@home');               //  帮助
        Route::get('/download', 'Download\IndexController@index');               //  下载


        Route::get('/pc/install', function(){return view('WAP.Help.pc_install')->with('title','帮助');});               //  帮助
        Route::get('/android/download', function(){return view('WAP.Help.android_download')->with('title','帮助');});               //  帮助
        Route::get('/switch/ip', function(){return view('WAP.Help.switch_ip')->with('title','帮助');});               //  帮助
        Route::get('/pc/recharge', function(){return view('WAP.Help.pc_recharge')->with('title','帮助');});               //  帮助
        Route::get('/wap/buy', function(){return view('WAP.Help.wap_buy')->with('title','帮助');});               //  帮助
        Route::get('/contact/us', function(){return view('WAP.User.contact_us')->with('title','我的');});               //
        Route::get('/ios/document', function(){return view('WAP.Help.ios_document')->with('title','帮助');});               //  帮助
        Route::get('/android/document', function(){return view('WAP.Help.android_document')->with('title','帮助');});               //  帮助



        Route::get('/detail', 'Help\IndexController@detail');                           //  详情

        Route::get('/login', 'User\LoginController@login');                             // 登录
        Route::post('/dologin', 'User\LoginController@doLogin');                         // 登录
        Route::get('/register', 'User\RegisterController@register');                  // 注册
        Route::post('/doregister', 'User\RegisterController@doRegister');                  // 注册
        Route::get('/logout', 'User\LogoutController@logout');                          //  注销

        Route::get('/send/code', 'User\IndexController@sendCode');                          // 发送验证码
        Route::get('/validateCode', 'ValidateCode\ValidateCodeController@doimg');           // 验证码
        Route::get('/getcode', 'ValidateCode\ValidateCodeController@doimg');                // 验证码

        Route::post('/code', 'Code\CodeController@getCode');                                 // 短信验证码



        Route::group(['middleware' => ['Login']], function () {

            Route::get('/user', 'User\IndexController@index');                                //   个人中心
            Route::get('/pay', 'Pay\PayController@index');                                  //   购买
            Route::get('/createOrder', 'Pay\PayController@createOrder');                                  //  生成订单
            Route::get('/aliPay', 'Pay\PayController@aliPay');                                  //  调起支付宝

        });
    });


});
